import Vue from 'vue'
import Router from 'vue-router'
import BookCase from '../views/BookCase'

Vue.use(Router)

export default new Router({
  routes: [
    {
      // 书籍列表(书架)
      path: '/',
      name: 'bookCase',
      component: BookCase
    },
    {
      // 书籍阅读器
      path: '/reader/:id',
      name: 'bookReader',
      component: () => import(/* webpackChunkName: "book-reader" */ '../views/BookReader')
    },
    {
      // 书籍详情
      path: '/details/:id',
      name: 'bookDetails',
      component: () => import(/* webpackChunkName: "book-details" */ '../views/BookDetails')
    },
    {
      // 书籍目录
      path: '/directory',
      name: 'bookDirectory',
      component: () => import(/* webpackChunkName: "book-directory" */ '../views/BookDirectory')
    },
    {
      // 书籍搜索
      path: '/search',
      name: 'bookSearch',
      component: () => import(/* webpackChunkName: "book-search" */ '../views/BookSearch')
    }
  ]
})
